﻿using System;
using System.Collections.Generic;
using System.Text;
using ContentRenderingApi.Extender;

namespace ContentRenderingApi.Skeleton
{
    /// <summary/>
    internal class GlobalFormatterSkeleton 
    {
        private Type _type;
        private Func<object, string> _formatterCallback;

        /// <summary/>
        internal GlobalFormatterSkeleton(
            Type type,
            Func<object, string> formatterCallback)
        {
            this._type = type;
            this._formatterCallback = formatterCallback;
        }

        /// <summary/>
        public string Invoke(object value)
        {
            return this._formatterCallback(value);
        }

        /// <summary/>
        public Type Type
        {
            get { return this._type; }
        }
    }
}
